package timbap.visualizer.api.model;


/**
 * The <code>RecordItem</code> class represents a record item of the
 * visualizer. It has a reference to the transformation and
 * to the currently attached playlist entry.  
 *
 * @author  Andreas Pabst
 * @see     timbap.visualizer.api.context.recorditems.RecordItemManager
 * @see     timbap.visualizer.api.plugin.recorditems.RecordItemsPlugin
 * @see     PlaylistEntry
 */
public class RecordItem {
    
    private PlaylistEntry playlistEntry;
    private String name;
    private Transformation transformation;
    private boolean selected = false;
    private boolean playing = false;
    private float fractionPlayed = 0;

    public RecordItem(PlaylistEntry pPlaylistEntry, String pName) {
        playlistEntry = pPlaylistEntry;
        name = pName;
        transformation = new Transformation();
    }
    
    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
    
    public PlaylistEntry getPlaylistEntry() {
        return playlistEntry;
    }

    public void setPlaylistEntry(PlaylistEntry pPlaylistEntry) {
        this.playlistEntry = pPlaylistEntry;
    }
    
    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public boolean isPlaying() {
        return playing;
    }

    public void setPlaying(boolean playing) {
        this.playing = playing;
    }

    public float getFractionPlayed() {
        return fractionPlayed;
    }

    public void setFractionPlayed(float fractionPlayed) {
        this.fractionPlayed = fractionPlayed;
    }

    public Transformation getTransformation() {
        return transformation;
    }
    
    @Override
    public String toString() {
    	return getName();
    }

}
